package model

import "gorm.io/gorm"

type Category struct {
	gorm.Model
	CategoryId    string `gorm:"column:category_id;type:CHAR(38)  NOT NULL;comment:category唯一id"`
	Name          string `gorm:"column:name;type:VARCHAR(38)  NOT NULL;comment:分类名"`
	CategoryDesc  string `gorm:"category_desc;type:VARCHAR(50) NOT NULL; comment:描述"`
	CategoryImage string `gorm:"category_image;NOT NULL; comment:分类图片"`
}

func (Category) TableName() string {
	return "categories"
}

type CategoryInfo struct {
	CategoryId    string `json:"category_id"`
	Name          string `json:"name"`
	CategoryDesc  string `json:"category_desc"`
	CategoryImage string `json:"category_image"`
}
